<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定时跳转</title>
    <style type="text/css">
        body {
            background-image: url("../images/key.jpg");
            background-size: 100%;
        }

        div {
            margin: 20px auto;
            width: 350px;
            height: 150px;
            border: 1px solid #000;
            background: white;
            padding: 10px;
            opacity: 0.7;
        }

        h2 {
            text-align: center;
        }

        span {
            font-size: 150%;
            color: red;
            margin: 0 10px;
        }
    </style>
</head>
<body>
<div>
    <h2>提交成功</h2>
    <a href="https://wht.im/">
        <span id="seconds">3</span>秒后系统会自动跳转，也可单机此链接跳转
    </a>
</div>
</body>
<script>
    /**
     * @Description: 
     * @author 朱志文
     * @date 2021/10/27 
    */
    function timing(secs, url) {
        var seconds = document.getElementById("seconds");
        seconds.innerHTML = --secs;
        if (secs > 0) {
            setTimeout('timing(' + secs + ',\'' + url + '\')', 1000);
        } else {
            location.href = url;
        }
    }

    timing(3, 'https://wht.im/')
</script>
</html>